var RansonAssistant = Class.create(AbstractModule, {


setupWidgets: function() {

		//About
		this.controller.setupWidget(Mojo.Menu.appMenu, {
			omitDefaultItems: true
		}, {
			visible: true,
			items: [
      		Mojo.Menu.editItem,
			{ label: "Disclaimer", command: "do-disclaimer" },					
				{ label: "License", command: "do-license" },
				{ label: "Help", command: "do-help" }
			]
		});	

	this.toggleModel = {
		ageCHK: false
			};
	this.toggleModel = {
			wbcCHK: false
			};
			
	this.toggleModel = {
			glucoseCHK: false
			};						
	this.toggleModel = {
			astCHK: false
			};
			
	this.toggleModel = {
			ldhCHK: false
			};
			
	this.toggleModel = {
			hctCHK: false
			};
			
	this.toggleModel = {
			bunCHK:false		
			};									

	this.toggleModel = {
			calciumCHK:false		
			};				

	this.toggleModel = {
			po2CHK:false		
			};	
	this.toggleModel = {
			baseCHK:false		
			};		
	this.toggleModel = {
			fluidsCHK:false		
			};									


	this.controller.setupWidget("ageCHK", {
			modelProperty: "ageCHK"
		}, this.toggleModel);
	this.controller.setupWidget("wbcCHK", {
			modelProperty: "wbcCHK"
		}, this.toggleModel);
	this.controller.setupWidget("glucoseCHK", {
			modelProperty: "glucoseCHK"
		}, this.toggleModel);
	this.controller.setupWidget("astCHK", {
			modelProperty: "astCHK"
		}, this.toggleModel);
	this.controller.setupWidget("ldhCHK", {
			modelProperty: "ldhCHK"
		}, this.toggleModel);		
	this.controller.setupWidget("hctCHK", {
			modelProperty: "hctCHK"
		}, this.toggleModel);
	this.controller.setupWidget("bunCHK", {
			modelProperty: "bunCHK"
		}, this.toggleModel);
	this.controller.setupWidget("calciumCHK", {
			modelProperty: "calciumCHK"
		}, this.toggleModel);		
	this.controller.setupWidget("po2CHK", {
			modelProperty: "po2CHK"
		}, this.toggleModel);
	this.controller.setupWidget("baseCHK", {
			modelProperty: "baseCHK"
		}, this.toggleModel);
	this.controller.setupWidget("fluidsCHK", {
			modelProperty: "fluidsCHK"
		}, this.toggleModel);					
},



	calculate: function() {
	var result = ransoncalc(this.toggleModel.ageCHK,this.toggleModel.wbcCHK,this.toggleModel.glucoseCHK,this.toggleModel.astCHK,this.toggleModel.ldhCHK,this.toggleModel.hctCHK,this.toggleModel.bunCHK,this.toggleModel.calciumCHK,this.toggleModel.po2CHK,this.toggleModel.baseCHK,this.toggleModel.fluidsCHK);

	return "The score is " + result.ransonscore + "<br />Severe pancreatitis is " + result.severity + " and this also predicts " +result.mortality;
	}
});





